<%@include file="startUpIncludes.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
            Register As Owner
        </title>
  <script type="text/javascript" src="../js/validation.js">
  </script>
 <script type="text/javascript" src="../js/validationRegister.js">
   </script>

<script type="text/javascript">
function doKeyUpValidation(text) {
    var validationRegex = RegExp(/[1-9]+/, "g");  // The regex was wrong
    if( !validationRegex.match(text.value) )
    {
        alert('Please enter only numbers.');
    }
} // this was missing before
</script>
<script type="text/javascript">
$(document).ready(function(){
    $('[id^=empNum]').keypress(validateNumber);
});

function validateNumber(event) {
    var key = window.event ? event.keyCode : event.which;

    if (event.keyCode == 8 || event.keyCode == 46
     || event.keyCode == 37 || event.keyCode == 39) {
        return true;
    }
    else if ( key < 48 || key > 57 ) {
        return false;
    }
    else return true;
};
        </script>
    </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="false" name="loggedIn"/>
	</jsp:include>
    <div class="wrap">
	<div class="fitBG">
        <div class="header">
        <div class="header-top">
            <div class="log">
                <a href="login">Sign In</a>
                <a href="#">Sign Up</a>
            </div>
        </div>
        <div class="top-menu">
            <a href="#" class="active">Home</a>
            <a href="#">About Us</a>
            <a href="#">Services</a>
            <a href="#">Solutions</a>
            <a href="#">Contacts</a>
            <a href="#">Company</a>
        </div>
        </div>
        <div class="main">
            <div class="already-login reg"><span>Already Registered? </span><a href="login" class="imp">Sign In</a></div>
        <div class="reg-box owner-reg">
            <form:form class="reg-form"  method="post" action="/sales/s/ownerRegister" commandName="ownRegisterForm" autocomplete="off">
          <form:errors cssClass="error-duplicate-email" path="*"></form:errors >
                <label>First Name: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="fName" path="fName" />
                <label>Last Name: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="lName" path="lName" />
                <label>Email: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="email" path="email" />
                <label>Username: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="username" path="username" />
                <label>Company: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="company" path="company" />
                <label>Phone: <span class="required">*</span></label>
                <form:input type="text" class="TB" id="phone" path="phone" />
                <label for="empNum">No. of Employees: </label>
				<form:input path="empNum" class="TB" id="empNum" name="empNum" placeholder="--None--" maxlength="4"/>
                <label>Country: <span class="required">*</span></label>
                <form:select class="TB" id="country" path="country" >
					<c:forEach var="country" items="${countries}">
						<option value="${country.id}">${country.countryName}</option>
					</c:forEach>
				</form:select> 	
                <label>Password: <span class="required">*</span></label>
                <form:input type="password" class="TB" id="password" path="password" />
                <label>Repeat Password: <span class="required">*</span></label>
                <form:input type="password" class="TB" id="rePassword" path="rePassword"/>
                <input type="checkbox" class="chbox" name="chbox" id="chbox" />
                <label>I have read and agree</label><a href="#" class="terms">The terms of use</a>
                <input type="submit" value="Sign Up" class="form-btn reg-btn" />
             
            </form:form>
            <div class="valid">
            <div class="valid-line"><span class="done"></span><span class="error-msg f-name-error">First name is required.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg l-name-error">Last name is required.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg reg-email-error">Please enter a valid email.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg username-error">Username is required.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg reg-company-error">Company name is required.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg phone-error">Please enter a valid phone number.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg emp-num-error">Number of employees is required</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg country-error">Compnay location is required.</span></div>
            
           
            <div class="valid-line"><div class="strn">
                <span class="word">Strength</span>
                <div class="strn-meter">
                    <span class="short"></span>
                    <span class="weak"></span>
                    <span class="good"></span>
                    <span class="strong"></span>
                    <span class="very-strong"></span>
                </div>
            </div><span class="error-msg reg-password-error">Please enter strong password.</span></div>
            <div class="valid-line"><span class="done"></span><span class="error-msg reg-rePassword-error">These passwords don't match.</span></div>
              <div class="valid-line"><span class="done"></span><span class="error-msg check-terms-error" style="display:block; visibility: hidden;">You have to check terms</span></div>
            </div>
           
        </div>
        </div>
        
	<%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>